<?php
/**
 * Created by JetBrains PhpStorm.
 * User: dvynograd
 * Date: 22.01.13
 * Time: 15:22
 * To change this template use File | Settings | File Templates.
 */

namespace Vozminoski\StoreBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use Vozminoski\StoreBundle\Entity\Size;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;


class LoadSizeData extends AbstractFixture implements OrderedFixtureInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $size = new Size();
        $size->setIsActive(true);
        $size->setOrder(1);
        $size->setSize(27);
        $size->setShoeSize('41-43');
        $manager->persist($size);

        $size = new Size();
        $size->setIsActive(true);
        $size->setOrder(2);
        $size->setSize(27);
        $size->setShoeSize('41-43');
        $manager->persist($size);

        $size = new Size();
        $size->setIsActive(true);
        $size->setOrder(3);
        $size->setSize(28);
        $size->setShoeSize('41-43');
        $manager->persist($size);


        $size = new Size();
        $size->setIsActive(true);
        $size->setOrder(4);
        $size->setSize(29);
        $size->setShoeSize('41-43');
        $manager->persist($size);

        $size = new Size();
        $size->setIsActive(true);
        $size->setOrder(5);
        $size->setSize(30);
        $size->setShoeSize('41-43');
        $manager->persist($size);

        $manager->flush();
    }

    /**
     * {@inheritDoc}
     */
    public function getOrder()
    {
        return 1; // the order in which fixtures will be loaded
    }
}